package com.isi.mtl.lf.ex3.services;

import java.io.IOException;
import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class BDDMapConfig {
	
	private static SqlMapClient bddMapClient;
	
	static {
		
		String ressource = "com/isi/mtl/lf/ex3/services/SqlMapConfig.xml";
		
		try {
			Reader reader = Resources.getResourceAsReader(ressource);
			bddMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);
			System.out.println("BDDMapClient "+bddMapClient);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	public static SqlMapClient getBddMapClient() {
		System.out.println("bddMapconfig "+bddMapClient);
		return bddMapClient;
	}

}
